import Vue from 'vue'
import Router from 'vue-router'
import Home from './views/Home.vue'
//引入登录组件
import Login from './views/Login.vue'

Vue.use(Router)

export default new Router({
  mode: 'history',
  base: process.env.BASE_URL,
  routes: [
    //首页
    {
      path: '/',
      name: 'home',
      component: Home
    },
    //关于
    {
      path: '/about',
      name: 'about',
      // route level code-splitting
      // this generates a separate chunk (about.[hash].js) for this route
      // which is lazy-loaded when the route is visited.
      component: () => import(/* webpackChunkName: "about" */ './views/About.vue')
    },
    //登录
    {
      path: '/login',
      name: 'login',
      component: Login
    },
    //添加用户
    {
      path: '/useradd',
      name: 'useradd',
      component: () => import(/* webpackChunkName: "about" */ './views/UserAdd.vue')
    },
    //用户管理
    {
      path: '/userlist',
      name: 'userlist',
      component: () => import(/* webpackChunkName: "about" */ './views/UserList.vue')
    },
    //密码修改
    {
      path: '/userpwdedit',
      name: 'userpwdedit',
      component: () => import(/* webpackChunkName: "about" */ './views/UserPwdEdit.vue')
    },
  ]
})
